local ziqiangbuxi = fk.CreateSkill {
  name = "lingling__ziqiangbuxi",
}

Fk:loadTranslationTable {
  ["lingling__ziqiangbuxi"] = "自强不息",
  [":lingling__ziqiangbuxi"] = "每种牌名限一次，你可以将一张非装备牌当【桃】使用。",

  ["#lingling__ziqiangbuxi"] = "自强不息：将一张牌当【桃】使用",
}

ziqiangbuxi:addEffect("viewas", {
  anim_type = "defensive",
  prompt = "#lingling__ziqiangbuxi",
  pattern = "peach",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type ~= Card.TypeEquip and
        not table.contains(player:getTableMark(ziqiangbuxi.name), Fk:getCardById(to_select).name)
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local c = Fk:cloneCard("peach")
    c.skillName = ziqiangbuxi.name
    c:addSubcard(cards[1])
    return c
  end,
  before_use = function(self, player, use)
    local card = Fk:getCardById(use.card.subcards[1]).name
    if card then
      player.room:addTableMark(player, ziqiangbuxi.name, card)
    end
  end,
  enabled_at_response = function(self, player, response)
    return not response
  end,
})

return ziqiangbuxi
